package com.bsoft.gol.hcs.specialist.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * 病种分期实体
 *
 * @author niule
 */
@Entity
@Table(name = "fus_disease_period")
public class DiseasePeriodEntity {
    private Long periodId;
    private Long diseaseTypeId;
    private Integer serialNumber;
    private String name;
    private String periodCode;
    private String abridge;
    private String remark;
    private String status;
    private Long parentPeriodId;
    private String level;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "GMT+8")
    private Date createTime;

    @Id
    @Column(name = "periodId")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getPeriodId() {
        return periodId;
    }

    public void setPeriodId(Long periodId) {
        this.periodId = periodId;
    }

    @Basic
    @Column(name = "disease_type_id")
    public Long getDiseaseTypeId() {
        return diseaseTypeId;
    }

    public void setDiseaseTypeId(Long diseaseTypeId) {
        this.diseaseTypeId = diseaseTypeId;
    }

    @Basic
    @Column(name = "serialNumber")
    public Integer getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(Integer serialNumber) {
        this.serialNumber = serialNumber;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "periodCode")
    public String getPeriodCode() {
        return periodCode;
    }

    public void setPeriodCode(String periodCode) {
        this.periodCode = periodCode;
    }

    @Basic
    @Column(name = "abridge")
    public String getAbridge() {
        return abridge;
    }

    public void setAbridge(String abridge) {
        this.abridge = abridge;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "status")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "parentPeriodId")
    public Long getParentPeriodId() {
        return parentPeriodId;
    }

    public void setParentPeriodId(Long parentPeriodId) {
        this.parentPeriodId = parentPeriodId;
    }

    @Basic
    @Column(name = "level")
    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    @Basic
    @Column(name = "createTime")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        DiseasePeriodEntity that = (DiseasePeriodEntity) o;
        return periodId.equals(that.periodId) &&
                Objects.equals(diseaseTypeId, that.diseaseTypeId) &&
                Objects.equals(serialNumber, that.serialNumber) &&
                Objects.equals(name, that.name) &&
                Objects.equals(periodCode, that.periodCode) &&
                Objects.equals(abridge, that.abridge) &&
                Objects.equals(remark, that.remark) &&
                Objects.equals(status, that.status) &&
                Objects.equals(parentPeriodId, that.parentPeriodId) &&
                Objects.equals(level, that.level) &&
                Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(periodId, diseaseTypeId, serialNumber, name, periodCode, abridge, remark,
                status, parentPeriodId, level, createTime);
    }
}
